package decorator;

/**
 * 装饰者模式
 *
 * 允许向现有的对象添加新的功能，同时不改变其结构
 *
 * <br>
 *     装饰器模式与代理模式的区别: 装饰器模式一般是将被装饰对象传入，而代理模式一般是内部创建类
 *
 * @author yi qiang
 * @date 2021/6/1 10:28
 */
public abstract class ShapeDecorator implements Shape{

    protected Shape decoratedShape;

    public ShapeDecorator(Shape decoratedShape){
        this.decoratedShape=decoratedShape;
    }

    @Override
    public void draw() {
        decoratedShape.draw();
    }
}
